package com.ghovos.usermangerpgdemo.vo.rep;

import com.ghovos.usermangerpgdemo.entity.MenuEntity;
import com.ghovos.usermangerpgdemo.entity.UserEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 用户entity 的返回
 * @author liuli
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class UserEntityRep extends UserEntity {
    Set<MenuEntity> menuEntityList = new HashSet<>();
    String token;

    public UserEntityRep(UserEntity userExt){
       setUsername(userExt.getUsername());
       setDepartmentEntity(userExt.getDepartmentEntity());
       setDepartmentId(userExt.getDepartmentId());
       setRoleEntities(userExt.getRoleEntities());
       setCreateTime(userExt.getCreateTime());
       setUpdateTime(userExt.getUpdateTime());
       setId(userExt.getId());
    }
}
